home *** CD-ROM | disk | FTP | other *** search
- property firstColorSticker, stickerList, firstStickerChan, currentLayer, constrainChan, bgChan, dragChan, dragFlag, placeFlag, maxStickers, placeConstrainFlag, currentBoundRect, printButChannel, stickerSongList, dragStickerCastPos, playList, firstTime, sceneDataString, dataCounter, firstColorBG, currentBG, howManyBGs, bgLocH, bgLocV, grayStickerOffset, firstGrayBG, songList, sandboxChan, printButCover, musicButObject
- global gActorList, gTrashObject, gRollAnimButton, gGasGaugeObject, gMenuObject, gAwardsObject, gMusicObject, gCDpath, gFileSep
-
- on birth me
- set firstTime to 1
- set constrainChan to 1
- set bgChan to 7
- set sandboxChan to 11
- set firstStickerChan to 16
- set printButChannel to 13
- set maxStickers to 30
- set dragFlag to 0
- set placeFlag to 0
- set dragChan to 48
- set stickerList to []
- set firstColorSticker to the number of cast "Sticker1" - 1
- set grayStickerOffset to the number of cast "BWsticker1" - firstColorSticker - 1
- set firstColorBG to the number of cast "blankScene"
- set firstGrayBG to the number of cast "blankScene.b+w"
- set currentBG to 1 + random(3)
- set howManyBGs to 4
- set bgLocH to 322
- set bgLocV to 213
- set placeConstrainFlag to 0
- set stickerSongList to [9, #x, 5, #x, 2, #x, 3, #x, 7, 4, #x, 6, 1, #x, #x, 8, #x, #x]
- set playList to []
- sort(playList)
- set songCounter to 0
- set songList to ["09FOREMU", "0716MU", "0713MU", "0715MU", "0714MU", "0717MU", "0718MU", "09TEAMMU", "09LADYMU"]
- set printButCover to the number of cast "printCoverMAS"
- return me
- end
-
- on fixBG me, firstBG
- set the type of sprite bgChan to 1
- set the castNum of sprite bgChan to firstBG + currentBG - 1
- set the locH of sprite bgChan to bgLocH
- set the locV of sprite bgChan to bgLocV
- puppetSprite(bgChan, 1)
- end
-
- on predraw me
- fixBG(me, firstColorBG)
- fixGasChannel(gGasGaugeObject)
- drawStickers(me, 1)
- puppetStickers(me)
- if the printEnabled of gMenuObject = 0 then
- set the castNum of sprite printButChannel to printButCover
- set the locH of sprite printButChannel to 287
- set the locV of sprite printButChannel to 429
- puppetSprite(printButChannel, 1)
- end if
- end
-
- on changeBG me
- if count(stickerList) = 0 then
- set currentBG to currentBG + 1
- if currentBG > howManyBGs then
- set currentBG to 1
- end if
- set the castNum of sprite bgChan to firstColorBG + currentBG - 1
- playSound("CHANGEBG")
- end if
- end
-
- on print me
- if the printEnabled of gMenuObject = 1 then
- clearAllActors()
- unpuppetAll()
- keepSandboxBut(sandboxChan)
- puppetPalette("ScenePal")
- go("Grass")
- set the stageColor to 0
- go(the frame + 1)
- puppetPalette("GrayScenePal", 60)
- updateStage()
- unLoadCast()
- fixBG(me, firstGrayBG)
- fixGasChannel(gGasGaugeObject)
- drawStickers(me, 1, grayStickerOffset)
- puppetStickers(me)
- puppetPalette(0)
- go("MASgray")
- copyScreenRegion(bgChan)
- printBitmap("LineArtTemp")
- resetCastMember()
- donePrinting(me)
- else
- copyScreenRegion(bgChan)
- printBitmap("LineArtTemp")
- resetCastMember()
- showAllActors()
- end if
- end
-
- on donePrinting me
- clearAllActors()
- unpuppetAll()
- puppetSprite(48, 1)
- puppetPalette("GrayScenePal")
- go("Grass")
- go(the frame + 1)
- set the stageColor to 255
- puppetPalette("ScenePal", 60)
- updateStage()
- puppetPalette(0)
- unLoadCast()
- predraw(me)
- go("MakeAscene")
- puppetSprite(48, 0)
- end
-
- on puppetStickers me
- repeat with x = 1 to count(stickerList)
- set channel to x + firstStickerChan - 1
- set the ink of sprite channel to 8
- puppetSprite(channel, 1)
- end repeat
- end
-
- on setup me
- if firstTime then
- set gTrashObject to birth(script "Trashcan Parent")
- set firstTime to 0
- end if
- clearAllActors()
- puppetAll()
- set musicButObject to birth(script "Rollover Anim Button Class", "playSongs( gSceneObject )", 14, 14, 4, "0713VO46", "0713RO46")
- add(gActorList, musicButObject)
- add(gActorList, birth(script "Rollover Anim Button Class", "goMenu( gSceneObject, me )", 11, 11, 5, "RCA-07VO01", "RCA-07RO01"))
- add(gActorList, birth(script "Rollover Anim Button Class", "help( gSceneObject, me )", 12, 12, 11, EMPTY, "RCA-05RO02"))
- if the printEnabled of gMenuObject then
- add(gActorList, birth(script "Rollover Anim Button Class", "print( gSceneObject )", 13, 13, 5, "0713VO03", "0713RO03"))
- end if
- end
-
- on update me
- if dragFlag = 1 then
- set the locV of sprite dragChan to the mouseV
- set the locH of sprite dragChan to the mouseH
- updateStage()
- if placeFlag = 1 then
- if placeConstrainFlag = 0 then
- if sprite dragChan within bgChan then
- set the rect of sprite constrainChan to currentBoundRect
- updateStage()
- set the constraint of sprite dragChan to constrainChan
- set placeConstrainFlag to 1
- end if
- end if
- else
- if rollOver(the mask of gTrashObject) then
- openTrash(gTrashObject)
- else
- closeTrash(gTrashObject)
- end if
- end if
- end if
- puppetTempo(60)
- end
-
- on stickerHandler me
- set dragChan to 46
- set currentLayer to the clickOn - firstStickerChan + 1
- set bmap to the castNum of sprite the clickOn
- set boundRect to getBoundRect(bmap, bgChan)
- set dragStickerCastPos to getAt(getAt(stickerList, currentLayer), 4)
- deleteAt(stickerList, currentLayer)
- set the rect of sprite constrainChan to boundRect
- set the castNum of sprite dragChan to bmap
- set the locH of sprite dragChan to the locH of sprite the clickOn
- set the locV of sprite dragChan to the locV of sprite the clickOn
- set the locH of sprite the clickOn to 1000
- updateStage()
- set the constraint of sprite dragChan to constrainChan
- animateSprite(dragChan, point(the mouseH, the mouseV), 3)
- set dragFlag to 1
- hideAllActors()
- add(gActorList, me)
- end
-
- on clickWhileDragging me
- if placeFlag = 1 then
- if sprite dragChan within bgChan then
- set bmap to the castNum of sprite dragChan
- add(stickerList, [bmap, the locH of sprite dragChan, the locV of sprite dragChan, dragStickerCastPos])
- set stickerChannel to firstStickerChan + count(stickerList) - 1
- set the castNum of sprite stickerChannel to bmap
- set the locH of sprite stickerChannel to the locH of sprite dragChan
- set the locV of sprite stickerChannel to the locV of sprite dragChan
- set the constraint of sprite dragChan to 0
- removeSprite(dragChan)
- updateStage()
- giveAward(gAwardsObject, "MakeAscene")
- set whichSong to getAt(stickerSongList, dragStickerCastPos)
- if whichSong <> #x then
- if getPos(playList, whichSong) = 0 then
- add(playList, whichSong)
- end if
- end if
- else
- if sprite dragChan intersects bgChan then
- set overlapFlag to 1
- end if
- if the mouseV < (the top of sprite bgChan + 50) then
- set destPoint to point(the mouseH, -100)
- else
- if the mouseV > (the bottom of sprite bgChan - 50) then
- set destPoint to point(the mouseH, 580)
- else
- if the mouseH > 320 then
- set destPoint to point(740, the mouseV)
- else
- set destPoint to point(-100, the mouseV)
- end if
- end if
- end if
- set the constraint of sprite dragChan to 0
- animateSprite(dragChan, destPoint, 3)
- removeSprite(dragChan)
- updateStage()
- end if
- set placeConstrainFlag to 0
- set placeFlag to 0
- else
- add(stickerList, [the castNum of sprite dragChan, the locH of sprite dragChan, the locV of sprite dragChan, dragStickerCastPos])
- set the constraint of sprite dragChan to 0
- removeSprite(dragChan)
- drawStickers(me, currentLayer)
- updateStage()
- end if
- set dragFlag to 0
- set gActorList to []
- showAllActors()
- end
-
- on newSticker me, choice
- set dragFlag to 1
- set placeFlag to 1
- set dragChan to 48
- set bmap to firstColorSticker + choice
- set the castNum of sprite dragChan to bmap
- set currentBoundRect to getBoundRect(bmap, bgChan)
- set the rect of sprite constrainChan to getBoundRect(firstColorSticker + choice, 0)
- updateStage()
- set the constraint of sprite dragChan to constrainChan
- set dragStickerCastPos to choice
- hideAllActors()
- add(gActorList, me)
- end
-
- on drawStickers me, firstLayer, offset
- repeat with x = firstLayer to count(stickerList)
- set stickerData to getAt(stickerList, x)
- set channel to x + firstStickerChan - 1
- set the castNum of sprite channel to getAt(stickerData, 1) + offset
- set the locH of sprite channel to getAt(stickerData, 2)
- set the locV of sprite channel to getAt(stickerData, 3)
- end repeat
- end
-
- on trashClick me
- startBuffering()
- if (placeFlag <> 1) and dragFlag then
- set the constraint of sprite dragChan to 0
- animateSprite(dragChan, the location of gTrashObject, 5)
- removeSprite(dragChan)
- set dragFlag to 0
- closeTrash(gTrashObject)
- repeat with x = 1 to count(stickerList) + 1
- set the locH of sprite (firstStickerChan + x - 1) to 1000
- end repeat
- drawStickers(me, 1)
- updateStage()
- set whichSong to getAt(stickerSongList, dragStickerCastPos)
- if whichSong <> #x then
- set songStillNeeded to 0
- repeat with sticker in stickerList
- set existingSong to getAt(stickerSongList, getAt(sticker, 4))
- if existingSong = whichSong then
- set songStillNeeded to 1
- exit repeat
- end if
- end repeat
- if songStillNeeded = 0 then
- deleteAt(playList, getPos(playList, whichSong))
- end if
- end if
- showAllActors()
- else
- if (count(stickerList) > 0) and not objectp(gRollAnimButton) then
- if placeFlag <> 1 then
- openTrash(gTrashObject)
- repeat with x = 1 to count(stickerList)
- set channel to x + firstStickerChan - 1
- removeSprite(channel)
- end repeat
- updateStage()
- set playList to []
- set stickerList to []
- closeTrash(gTrashObject)
- end if
- end if
- end if
- flushBuffer()
- end
-
- on playSongs me
- hideActor(musicButObject)
- set songTitleList to []
- repeat with song in playList
- add(songTitleList, getAt(songList, song))
- end repeat
- set songPath to gCDpath & "SOUND" & gFileSep & "SONGS" & gFileSep
- set gMusicObject to birth(script "Music Parent", me, songTitleList, songPath)
- add(gActorList, gMusicObject)
- set the mouseDownScript to "stopSound( gSceneObject )"
- end
-
- on stopSound me
- sound stop 1
- set the mouseDownScript to EMPTY
- clearActor(gMusicObject)
- set gMusicObject to EMPTY
- dontPassEvent()
- showAllActors()
- end
-
- on saveScene me
- set sceneDataString to EMPTY
- appendData(me, currentBG)
- appendData(me, count(stickerList))
- if count(stickerList) > 0 then
- repeat with sticker in stickerList
- repeat with x = 1 to 4
- appendData(me, getAt(sticker, x))
- end repeat
- end repeat
- appendData(me, count(playList))
- repeat with song in playList
- appendData(me, song)
- end repeat
- end if
- set returnString to sceneDataString
- set sceneDataString to EMPTY
- return returnString
- end
-
- on loadScene me, index
- set dataCounter to index
- set currentBG to readData(me)
- set stickerList to []
- set stickerQuantity to readData(me)
- if stickerQuantity > 0 then
- repeat with x = 1 to stickerQuantity
- set sticker to []
- repeat with y = 1 to 4
- add(sticker, readData(me))
- end repeat
- add(stickerList, sticker)
- end repeat
- set songQuantity to readData(me)
- set playList to []
- repeat with x = 1 to songQuantity
- set song to readData(me)
- add(playList, song)
- end repeat
- end if
- return dataCounter
- end
-
- on appendData me, datum
- set sceneDataString to sceneDataString & string(datum) & ","
- end
-
- on readData me
- set datum to value(item dataCounter of the dataString of gMenuObject)
- set dataCounter to dataCounter + 1
- return datum
- end
-
- on goMenu me, buttonObject
- if dragFlag <> 1 then
- set musicButObject to EMPTY
- makeButtonJump(buttonObject)
- unpuppetAll()
- puppetPalette("ScenePal", 60)
- go("Grass")
- clearAllActors()
- unLoadCast()
- go(the frame + 1)
- goLocationMap()
- end if
- end
-
- on help me, buttonObject
- birth(script "Help Parent", buttonObject, #MakeAscene)
- end
-